﻿using System;
using System.Windows.Controls;
using System.Windows.Navigation;
using FirstFloor.Documents.IO.DotNetZip;

namespace SampleBrowser.Views
{
    public partial class SampleBook : Page
    {
        public SampleBook()
        {
            InitializeComponent();

            this.Loaded += (o, e) => {
                this.DataSource.PackageReader = new DotNetZipPackageReader(new Uri("Assets/Documents/TestDocument.xps", UriKind.Relative));
            };
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);
            this.DataSource.PackageReader = null;
        }

    }
}
